import Index from '@/components/index'
import Login from '@/components/login'
import Register from '@/components/register'
import Vue from 'vue'
import Router from 'vue-router'
import productsList from '@/components/userstage/productsList'
import productView from '@/components/userstage/productView.vue'
import cart from '@/components/userstage/cart.vue'
import orderConfirm from '@/components/userstage/orderConfirm.vue'



Vue.use(Router)

export default new Router({
  routes: [

    {
      path: '/',
      name: 'Index',
      component: Index
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register

    },
 
    {
      path: '/main',
      name: 'main',
      component: () => import('@/components/main'),
      children: [
        {
          path: '/',
          name: 'categorylist',
          component: () => import('@/components/system/categorylist.vue')
        },
        {
          path: 'unit',
          name: 'unit',
          component: () => import('@/components/system/unit.vue')
        },
        {
          path: 'region',
          name: 'region',
          component: () => import('@/components/system/region.vue')
        },
        {
          path: 'product',
          name: 'product',
          component: () => import('@/components/system/product.vue')
        },
        {
          path: 'supplier',
          name: 'supplier',
          component: () => import('@/components/system/supplier.vue')
        },
        {
          path: 'customer',
          name: 'customer',
          component: () => import('@/components/system/customer.vue')
        },
        {
          path: 'warehouse',
          name: 'warehouse',
          component: () => import('@/components/system/warehouse.vue')
        },
        {
          path: 'department',
          name: 'department',
          component: () => import('@/components/system/department.vue')
        },
        {
          path: 'employee',
          name: 'employee',
          component: () => import('@/components/system/employee.vue')
        },
        {
          path: 'authority',
          name: 'authority',
          component: () => import('@/components/authority/authority.vue')
        },
        {
          path: 'noperms',
          name: 'noperms',
          component: () => import('@/components/authority/noperms.vue')
        },
        {

          path: 'receive',
          name: 'receive',
          component: () => import('@/components/wyycategory/receive.vue')
        },
        {
          path: 'pay',
          name: 'pay',
          component: () => import('@/components/wyycategory/pay.vue')
        },
        {
          path: 'Tmaterial',
          name: 'Tmaterial',
          component: () => import('@/components/wyycategory/Tmaterial.vue')
        },
        {
          path: 'TFproduct',
          name: 'TFproduct',
          component: () => import('@/components/wyycategory/TFproduct.vue')
        },
        {
          path: 'TUFproduvt',
          name: 'TUFproduvt',
          component: () => import('@/components/wyycategory/TUFproduvt.vue')
        },
        {
          path: 'Tcustomer',
          name: 'Tcustomer',
          component: () => import('@/components/wyycategory/Tcustomer.vue')
        },
        {
          path: 'Treceive',
          name: 'Treceive',
          component: () => import('@/components/wyycategory/Treceive.vue')
        },
        {
          path: 'Tpay',
          name: 'Tpay',
          component: () => import('@/components/wyycategory/Tpay.vue')
        },
        {
          path: 'orderManage',
          name: 'OrderManage',
          component: ()=>import('@/components/order/orderManage.vue')
        },
        {
          path: 'addOrder',
          name: 'AddOrder',
          component: ()=>import('@/components/order/addOrder.vue')
        },
        {
          path: 'orderCheck',
          name: 'OrderCheck',
          component: ()=>import('@/components/order/orderCheck.vue')
        },
        {
          path: 'orderSummary',
          name: 'OrderSummary',
          component: ()=>import('@/components/order/orderSummary.vue')
        },
        {
          path: 'purchasePlan',
          name: 'PurchasePlan',
          component: ()=>import('@/components/order/purchasePlan.vue')
        }
        ,{
          path: 'material',
          name: 'material',
          component: () => import('@/components/storage/material.vue')
        },
        ,{
          path: 'matReq',
          name: 'matReq',
          component: () => import('@/components/storage/material_requisition.vue')
        },
        ,{
          path: 'completeWare',
          name: 'completeWare',
          component: () => import('@/components/storage/complete_warehouse.vue')
        },
        {
          path: 'secondWarehouse',
          name: 'secondWarehouse',
          component: () => import('@/components/storage/second_warehouse.vue')
        },
        {
          path: 'completeProductsend',
          name: 'completeProductsend',
          component: () => import('@/components/storage/complete_productsend.vue')
        },
        {
          path: 'secondProductsend',
          name: 'secondProductsend',
          component: () => import('@/components/storage/second_productsend.vue')
        },
      ]
    },
    {
      path: '/productsList/:cid',  
      name: 'productsList',
      component: productsList
    },
    {
      path: '/productView/:pid',   
      name: 'productView',
      component: productView
    },
    {
      path: '/cart',   
      name: 'cart',
      component: cart
    },
    {
      path: '/orderConfirm',  
      name: 'orderConfirm',
      component: orderConfirm
    },
    {
      path: '/pay',  
      name: 'pay',
      component: () =>import('@/components/userstage/pay.vue')
    },
   
  ],
  mode:'history'
})
